package cmds

import (
	"os"
	"wrench/config"
)

func SetSyncWaitGroupChannel(config *config.Yaml, swg *config.SyncWaitGroupChannelType) {
	swg.CPUChannel, swg.CPUNums = AddRoutineChannel(len(config.HostList))
	swg.ConnChannel, swg.ConnNums = AddRoutineChannel(len(config.HostList))
}

func CheckFileIsExist(filename string) bool {
	var exist = true
	if _, err := os.Stat(filename); os.IsNotExist(err) {
		exist = false
	}
	return exist
}
